import request from "../utils/axios"
// 设置用户信息
export const getRealname=()=>{
    return request.get('/v1/index/user-realname')
}
export const editRealname=(data)=>{
    return request.post('/v1/index/user-realname',data)
}
export const putRealname=(id,data)=>{
   return request.put(`/v1/index/user-realname/${id}`,data)
}
// 设置交易密码
export const setTradingPin=(data)=>{
   return request.post(`/v1/index/edit-trading-pin`,data)
}
// 设置登入密码
export const setPassword=(data)=>{
   return request.post(`/v1/index/edit-password`,data)
}
// 积分商城
export const userPoints  = ()=>{
   return request.get(`/v1/index/user-points?page=1`)
}
export const getExchangePoints  = (page)=>{
   return request.get(`/v1/index/user-points-exchange?page=${page}`)
}
export const getPointsList = (page)=>{
   return request.get(`/v1/index/points-exchange?page=${page}`)
}
export const getExchangeId = (id)=>{
   return request.get(`/v1/index/user-points-exchange/${id}`)
}
// U盾设置
export const getUshieldAddress = (page)=>{
   return request.get(`/v1/index/user-ushield-address?page=${page}`)
}
export const addUshieldAddress = (data)=>{
   return request.post(`/v1/index/user-ushield-address`,data)
}
export const editUshield = (id,data)=>{
   return request.put(`/v1/index/user-ushield-address/${id}`,data)
}
export const delectUshield = (id)=>{
   return request.delete(`/v1/index/user-ushield-address/${id}`)
}
// 获取新闻数据
export const newList = (page,id)=>{
   if(page){
      return request.get(`/v1/index/news?page=${page}`)
   }else if(id){
      return request.get(`/v1/index/news/${id}`)
   }
   
}